package com.nondo.dean.platform.controller.api.inner;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.nondo.dean.common.annotation.ApiVersion;
import com.nondo.dean.common.web.View;
import com.nondo.dean.platform.model.AreaBean;
import com.nondo.dean.platform.service.ProvinceService;

/**
 * 省份管理内部接口
 * @author zlj
 * @date 2018年4月8日
 */
@RestController("apiInnerProvince")
@RequestMapping("/{v}/inner/province")
public class ProvinceController {
    
    @Autowired
    ProvinceService provinceService;
    
    /**
     * 获取省份列表
     * @return
     */
    @ApiVersion(1)
    @RequestMapping("/list/all")
    public View<List<AreaBean>> list(HttpServletRequest request, HttpServletResponse response) {
        View<List<AreaBean>> view = new View<List<AreaBean>>(20000, "获取列表成功");

        List<AreaBean> provinceList = provinceService.getProvinceList();
        
        view.setData(provinceList);
        
        return view;
    }
}